﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Security.Cryptography;

namespace SHA_1
{
    class SHA1
    {
        public static void Compute(string inputFileName, string outputFileName)
        {
            using (FileStream inFile = new FileStream(inputFileName, FileMode.Open, FileAccess.Read))
            {
                System.Security.Cryptography.SHA1 sha = new SHA1CryptoServiceProvider();

                byte[] hash = sha.ComputeHash(inFile);

                string hashAsStr = BitConverter.ToString(hash);

                using (StreamWriter outFile = new StreamWriter(outputFileName))
                {
                    outFile.WriteLine(hashAsStr);
                }
            }
        }

    }
}
